<!DOCTYPE html>
<html lang="en">
<head>
    <th:block th:include="include :: header('添加临时学生')"/>
</head>
<body>
<form class="form-horizontal m" id="form-record-temporaryStudent">
    <div class="row">
        <div class="container-div">
            <div class="col-sm-12 search-collapse">
                <form id="export-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                <input type="hidden" name="params[classId]" th:value="${teachingClasses.classId}">
                                <input type="hidden" name="courseId" th:value="${teachingClasses.courseId}">
                                学生：<input type="text" name="studentName" value=""/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm"
                                   onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</form>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var courseId = [[${courseId}]];

    $(function () {
        var options = {
            url: ctx + "teaching/apply/list",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            rememberSelected: true,
            columns: [{
                checkbox: true,
            },
                {
                    field: 'applyId',
                    title: '申请ID',
                    visible: false

                },
                {
                    field: 'studentName',
                    title: '学生姓名'
                },
                {
                    field: 'teachingSchool.name',
                    title: '报读校区'
                },
                {
                    field: 'lessonRemain',
                    title: '剩余课时'
                }
            ]
        };
        $.table.init(options);
    });

    /* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
    function getSelections(index) {
        return $.table.selectColumns(index, false);
        // return $.table.selectFirstColumns();
    }
    /* 添加用户-选择用户-提交 */
    function submitHandler() {
        // var t = $.table.selectFirstColumns();
        // console.log(t);
        // $("#students").val(t);
    }
</script>
</body>
</html>